/*!
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 2.12 (23-MAY-2011)
* Requires jQuery v1.3.2 or later
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Authors: Dave Methvin and Mike Alsup
*/

/**
*  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
*
*  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
*  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
*  width:   width of the effect; in the case of rounded corners this is the radius. 
*           specify this value using the px suffix such as 10px (yes, it must be pixels).
*/
; (function ($) {

    var style = document.createElement('div').style,
    moz = style['MozBorderRadius'] !== undefined,
    webkit = style['WebkitBorderRadius'] !== undefined,
    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
    mode = document.documentMode || 0,
    noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8),

    expr = $.browser.msie && (function () {
        var div = document.createElement('div');
        try { div.style.setExpression('width', '0+0'); div.style.removeExpression('width'); }
        catch (e) { return false; }
        return true;
    })();

    $.support = $.support || {};
    $.support.borderRadius = moz || webkit || radius; // so you can do:  if (!$.support.borderRadius) $('#myDiv').corner();

    function sz(el, p) {
        return parseInt($.css(el, p)) || 0;
    };
    function hex2(s) {
        s = parseInt(s).toString(16);
        return (s.length < 2) ? '0' + s : s;
    };
    function gpc(node) {
        while (node) {
            var v = $.css(node, 'backgroundColor'), rgb;
            if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
                if (v.indexOf('rgb') >= 0) {
                    rgb = v.match(/\d+/g);
                    return '#' + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
                }
                return v;
            }
            if (node.nodeName.toLowerCase() == 'html')
                break;
            node = node.parentNode; // keep walking if transparent
        }
        return '#ffffff';
    };

    function getWidth(fx, i, width) {
        switch (fx) {
            case 'round': return Math.round(width * (1 - Math.cos(Math.asin(i / width))));
            case 'cool': return Math.round(width * (1 + Math.cos(Math.asin(i / width))));
            case 'sharp': return width - i;
            case 'bite': return Math.round(width * (Math.cos(Math.asin((width - i - 1) / width))));
            case 'slide': return Math.round(width * (Math.atan2(i, width / i)));
            case 'jut': return Math.round(width * (Math.atan2(width, (width - i - 1))));
            case 'curl': return Math.round(width * (Math.atan(i)));
            case 'tear': return Math.round(width * (Math.cos(i)));
            case 'wicked': return Math.round(width * (Math.tan(i)));
            case 'long': return Math.round(width * (Math.sqrt(i)));
            case 'sculpt': return Math.round(width * (Math.log((width - i - 1), width)));
            case 'dogfold':
            case 'dog': return (i & 1) ? (i + 1) : width;
            case 'dog2': return (i & 2) ? (i + 1) : width;
            case 'dog3': return (i & 3) ? (i + 1) : width;
            case 'fray': return (i % 2) * width;
            case 'notch': return width;
            case 'bevelfold':
            case 'bevel': return i + 1;
            case 'steep': return i / 2 + 1;
            case 'invsteep': return (width - i) / 2 + 1;
        }
    };

    $.fn.corner = function (options) {
        // in 1.3+ we can fix mistakes with the ready state
        if (this.length == 0) {
            if (!$.isReady && this.selector) {
                var s = this.selector, c = this.context;
                $(function () {
                    $(s, c).corner(options);
                });
            }
            return this;
        }

        return this.each(function (index) {
            var $this = $(this),
            // meta values override options
            o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
            keep = /keep/.test(o),                       // keep borders?
            cc = ((o.match(/cc:(#[0-9a-f]+)/) || [])[1]),  // corner color
            sc = ((o.match(/sc:(#[0-9a-f]+)/) || [])[1]),  // strip color
            width = parseInt((o.match(/(\d+)px/) || [])[1]) || 10, // corner width
            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/,
            fx = ((o.match(re) || ['round'])[0]),
            fold = /dogfold|bevelfold/.test(o),
            edges = { T: 0, B: 1 },
            opts = {
                TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o),
                BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o)
            },
            // vars used in func later
            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;

            if (!opts.TL && !opts.TR && !opts.BL && !opts.BR)
                opts = { TL: 1, TR: 1, BL: 1, BR: 1 };

            // support native rounding
            if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
                if (opts.TL)
                    $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
                if (opts.TR)
                    $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
                if (opts.BL)
                    $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
                if (opts.BR)
                    $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
                return;
            }

            strip = document.createElement('div');
            $(strip).css({
                overflow: 'hidden',
                height: '1px',
                minHeight: '1px',
                fontSize: '1px',
                backgroundColor: sc || 'transparent',
                borderStyle: 'solid'
            });

            pad = {
                T: parseInt($.css(this, 'paddingTop')) || 0, R: parseInt($.css(this, 'paddingRight')) || 0,
                B: parseInt($.css(this, 'paddingBottom')) || 0, L: parseInt($.css(this, 'paddingLeft')) || 0
            };

            if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
            if (!keep) this.style.border = 'none';
            strip.style.borderColor = cc || gpc(this.parentNode);
            cssHeight = $(this).outerHeight();

            for (j in edges) {
                bot = edges[j];
                // only add stips if needed
                if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                    strip.style.borderStyle = 'none ' + (opts[j + 'R'] ? 'solid' : 'none') + ' none ' + (opts[j + 'L'] ? 'solid' : 'none');
                    d = document.createElement('div');
                    $(d).addClass('jquery-corner');
                    ds = d.style;

                    bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                    if (bot && cssHeight != 'auto') {
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.bottom = ds.left = ds.padding = ds.margin = '0';
                        if (expr)
                            ds.setExpression('width', 'this.parentNode.offsetWidth');
                        else
                            ds.width = '100%';
                    }
                    else if (!bot && $.browser.msie) {
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';

                        // fix ie6 problem when blocked element has a border width
                        if (expr) {
                            bw = sz(this, 'borderLeftWidth') + sz(this, 'borderRightWidth');
                            ds.setExpression('width', 'this.parentNode.offsetWidth - ' + bw + '+ "px"');
                        }
                        else
                            ds.width = '100%';
                    }
                    else {
                        ds.position = 'relative';
                        ds.margin = !bot ? '-' + pad.T + 'px -' + pad.R + 'px ' + (pad.T - width) + 'px -' + pad.L + 'px' :
                                        (pad.B - width) + 'px -' + pad.R + 'px -' + pad.B + 'px -' + pad.L + 'px';
                    }

                    for (i = 0; i < width; i++) {
                        w = Math.max(0, getWidth(fx, i, width));
                        e = strip.cloneNode(false);
                        e.style.borderWidth = '0 ' + (opts[j + 'R'] ? w : 0) + 'px 0 ' + (opts[j + 'L'] ? w : 0) + 'px';
                        bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                    }

                    if (fold && $.support.boxModel) {
                        if (bot && noBottomFold) continue;
                        for (c in opts) {
                            if (!opts[c]) continue;
                            if (bot && (c == 'TL' || c == 'TR')) continue;
                            if (!bot && (c == 'BL' || c == 'BR')) continue;

                            common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
                            $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
                            switch (c) {
                                case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
                                case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
                                case 'BL': $horz.css({ top: 0, left: 0 }); break;
                                case 'BR': $horz.css({ top: 0, right: 0 }); break;
                            }
                            d.appendChild($horz[0]);

                            var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
                            switch (c) {
                                case 'TL': $vert.css({ left: width }); break;
                                case 'TR': $vert.css({ right: width }); break;
                                case 'BL': $vert.css({ left: width }); break;
                                case 'BR': $vert.css({ right: width }); break;
                            }
                            d.appendChild($vert[0]);
                        }
                    }
                }
            }
        });
    };

    $.fn.uncorner = function () {
        if (radius || moz || webkit)
            this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
        $('div.jquery-corner', this).remove();
        return this;
    };

    // expose options
    $.fn.corner.defaults = {
        useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
        metaAttr: 'data-corner' // name of meta attribute to use for options
    };

})(jQuery);
/* http://keith-wood.name/countdown.html
Countdown for jQuery v1.5.2.
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
Please attribute the author if you use it. */
(function ($) { function Countdown() { this.regional = []; this.regional[''] = { labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'], labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'], compactLabels: ['y', 'm', 'w', 'd'], timeSeparator: ':', isRTL: false }; this._defaults = { until: null, since: null, timezone: null, format: 'dHMS', layout: '', compact: false, description: '', expiryUrl: '', expiryText: '', alwaysExpire: false, onExpiry: null, onTick: null }; $.extend(this._defaults, this.regional['']) } var s = 'countdown'; var Y = 0; var O = 1; var W = 2; var D = 3; var H = 4; var M = 5; var S = 6; $.extend(Countdown.prototype, { markerClassName: 'hasCountdown', _timer: setInterval(function () { $.countdown._updateTargets() }, 980), _timerTargets: [], setDefaults: function (a) { this._resetExtraLabels(this._defaults, a); extendRemove(this._defaults, a || {}) }, UTCDate: function (a, b, c, e, f, g, h, i) { if (typeof b == 'object' && b.constructor == Date) { i = b.getMilliseconds(); h = b.getSeconds(); g = b.getMinutes(); f = b.getHours(); e = b.getDate(); c = b.getMonth(); b = b.getFullYear() } var d = new Date(); d.setUTCFullYear(b); d.setUTCDate(1); d.setUTCMonth(c || 0); d.setUTCDate(e || 1); d.setUTCHours(f || 0); d.setUTCMinutes((g || 0) - (Math.abs(a) < 30 ? a * 60 : a)); d.setUTCSeconds(h || 0); d.setUTCMilliseconds(i || 0); return d }, _attachCountdown: function (a, b) { var c = $(a); if (c.hasClass(this.markerClassName)) { return } c.addClass(this.markerClassName); var d = { options: $.extend({}, b), _periods: [0, 0, 0, 0, 0, 0, 0] }; $.data(a, s, d); this._changeCountdown(a) }, _addTarget: function (a) { if (!this._hasTarget(a)) { this._timerTargets.push(a) } }, _hasTarget: function (a) { return ($.inArray(a, this._timerTargets) > -1) }, _removeTarget: function (b) { this._timerTargets = $.map(this._timerTargets, function (a) { return (a == b ? null : a) }) }, _updateTargets: function () { for (var i = 0; i < this._timerTargets.length; i++) { this._updateCountdown(this._timerTargets[i]) } }, _updateCountdown: function (a, b) { var c = $(a); b = b || $.data(a, s); if (!b) { return } c.html(this._generateHTML(b)); c[(this._get(b, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl'); var d = this._get(b, 'onTick'); if (d) { d.apply(a, [b._hold != 'lap' ? b._periods : this._calculatePeriods(b, b._show, new Date())]) } var e = b._hold != 'pause' && (b._since ? b._now.getTime() <= b._since.getTime() : b._now.getTime() >= b._until.getTime()); if (e && !b._expiring) { b._expiring = true; if (this._hasTarget(a) || this._get(b, 'alwaysExpire')) { this._removeTarget(a); var f = this._get(b, 'onExpiry'); if (f) { f.apply(a, []) } var g = this._get(b, 'expiryText'); if (g) { var h = this._get(b, 'layout'); b.options.layout = g; this._updateCountdown(a, b); b.options.layout = h } var i = this._get(b, 'expiryUrl'); if (i) { window.location = i } } b._expiring = false } else if (b._hold == 'pause') { this._removeTarget(a) } $.data(a, s, b) }, _changeCountdown: function (a, b, c) { b = b || {}; if (typeof b == 'string') { var d = b; b = {}; b[d] = c } var e = $.data(a, s); if (e) { this._resetExtraLabels(e.options, b); extendRemove(e.options, b); this._adjustSettings(e); $.data(a, s, e); var f = new Date(); if ((e._since && e._since < f) || (e._until && e._until > f)) { this._addTarget(a) } this._updateCountdown(a, e) } }, _resetExtraLabels: function (a, b) { var c = false; for (var n in b) { if (n.match(/[Ll]abels/)) { c = true; break } } if (c) { for (var n in a) { if (n.match(/[Ll]abels[0-9]/)) { a[n] = null } } } }, _destroyCountdown: function (a) { var b = $(a); if (!b.hasClass(this.markerClassName)) { return } this._removeTarget(a); b.removeClass(this.markerClassName).empty(); $.removeData(a, s) }, _pauseCountdown: function (a) { this._hold(a, 'pause') }, _lapCountdown: function (a) { this._hold(a, 'lap') }, _resumeCountdown: function (a) { this._hold(a, null) }, _hold: function (a, b) { var c = $.data(a, s); if (c) { if (c._hold == 'pause' && !b) { c._periods = c._savePeriods; var d = (c._since ? '-' : '+'); c[c._since ? '_since' : '_until'] = this._determineTime(d + c._periods[0] + 'y' + d + c._periods[1] + 'o' + d + c._periods[2] + 'w' + d + c._periods[3] + 'd' + d + c._periods[4] + 'h' + d + c._periods[5] + 'm' + d + c._periods[6] + 's'); this._addTarget(a) } c._hold = b; c._savePeriods = (b == 'pause' ? c._periods : null); $.data(a, s, c); this._updateCountdown(a, c) } }, _getTimesCountdown: function (a) { var b = $.data(a, s); return (!b ? null : (!b._hold ? b._periods : this._calculatePeriods(b, b._show, new Date()))) }, _get: function (a, b) { return (a.options[b] != null ? a.options[b] : $.countdown._defaults[b]) }, _adjustSettings: function (a) { var b = new Date(); var c = this._get(a, 'timezone'); c = (c == null ? -new Date().getTimezoneOffset() : c); a._since = this._get(a, 'since'); if (a._since) { a._since = this.UTCDate(c, this._determineTime(a._since, null)) } a._until = this.UTCDate(c, this._determineTime(this._get(a, 'until'), b)); a._show = this._determineShow(a) }, _determineTime: function (k, l) { var m = function (a) { var b = new Date(); b.setTime(b.getTime() + a * 1000); return b }; var n = function (a) { a = a.toLowerCase(); var b = new Date(); var c = b.getFullYear(); var d = b.getMonth(); var e = b.getDate(); var f = b.getHours(); var g = b.getMinutes(); var h = b.getSeconds(); var i = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g; var j = i.exec(a); while (j) { switch (j[2] || 's') { case 's': h += parseInt(j[1], 10); break; case 'm': g += parseInt(j[1], 10); break; case 'h': f += parseInt(j[1], 10); break; case 'd': e += parseInt(j[1], 10); break; case 'w': e += parseInt(j[1], 10) * 7; break; case 'o': d += parseInt(j[1], 10); e = Math.min(e, $.countdown._getDaysInMonth(c, d)); break; case 'y': c += parseInt(j[1], 10); e = Math.min(e, $.countdown._getDaysInMonth(c, d)); break } j = i.exec(a) } return new Date(c, d, e, f, g, h, 0) }; var o = (k == null ? l : (typeof k == 'string' ? n(k) : (typeof k == 'number' ? m(k) : k))); if (o) o.setMilliseconds(0); return o }, _getDaysInMonth: function (a, b) { return 32 - new Date(a, b, 32).getDate() }, _generateHTML: function (c) { c._periods = periods = (c._hold ? c._periods : this._calculatePeriods(c, c._show, new Date())); var d = false; var e = 0; for (var f = 0; f < c._show.length; f++) { d |= (c._show[f] == '?' && periods[f] > 0); c._show[f] = (c._show[f] == '?' && !d ? null : c._show[f]); e += (c._show[f] ? 1 : 0) } var g = this._get(c, 'compact'); var h = this._get(c, 'layout'); var i = (g ? this._get(c, 'compactLabels') : this._get(c, 'labels')); var j = this._get(c, 'timeSeparator'); var k = this._get(c, 'description') || ''; var l = function (a) { var b = $.countdown._get(c, 'compactLabels' + periods[a]); return (c._show[a] ? periods[a] + (b ? b[a] : i[a]) + ' ' : '') }; var m = function (a) { var b = $.countdown._get(c, 'labels' + periods[a]); return (c._show[a] ? '<span class="countdown_section"><span class="countdown_amount">' + periods[a] + '</span><br/>' + (b ? b[a] : i[a]) + '</span>' : '') }; return (h ? this._buildLayout(c, h, g) : ((g ? '<span class="countdown_row countdown_amount' + (c._hold ? ' countdown_holding' : '') + '">' + l(Y) + l(O) + l(W) + l(D) + (c._show[H] ? this._twoDigits(periods[H]) : '') + (c._show[M] ? (c._show[H] ? j : '') + this._twoDigits(periods[M]) : '') + (c._show[S] ? (c._show[H] || c._show[M] ? j : '') + this._twoDigits(periods[S]) : '') : '<span class="countdown_row countdown_show' + e + (c._hold ? ' countdown_holding' : '') + '">' + m(Y) + m(O) + m(W) + m(D) + m(H) + m(M) + m(S)) + '</span>' + (k ? '<span class="countdown_row countdown_descr">' + k + '</span>' : ''))) }, _buildLayout: function (b, c, d) { var e = (d ? this._get(b, 'compactLabels') : this._get(b, 'labels')); var f = function (a) { return ($.countdown._get(b, (d ? 'compactLabels' : 'labels') + b._periods[a]) || e)[a] }; var g = { yl: f(Y), yn: b._periods[Y], ynn: this._twoDigits(b._periods[Y]), ol: f(O), on: b._periods[O], onn: this._twoDigits(b._periods[O]), wl: f(W), wn: b._periods[W], wnn: this._twoDigits(b._periods[W]), dl: f(D), dn: b._periods[D], dnn: this._twoDigits(b._periods[D]), hl: f(H), hn: b._periods[H], hnn: this._twoDigits(b._periods[H]), ml: f(M), mn: b._periods[M], mnn: this._twoDigits(b._periods[M]), sl: f(S), sn: b._periods[S], snn: this._twoDigits(b._periods[S]) }; var h = c; for (var i = 0; i < 7; i++) { var j = 'yowdhms'.charAt(i); var k = new RegExp('\\{' + j + '<\\}(.*)\\{' + j + '>\\}', 'g'); h = h.replace(k, (b._show[i] ? '$1' : '')) } $.each(g, function (n, v) { var a = new RegExp('\\{' + n + '\\}', 'g'); h = h.replace(a, v) }); return h }, _twoDigits: function (a) { return (a < 10 ? '0' : '') + a }, _determineShow: function (a) { var b = this._get(a, 'format'); var c = []; c[Y] = (b.match('y') ? '?' : (b.match('Y') ? '!' : null)); c[O] = (b.match('o') ? '?' : (b.match('O') ? '!' : null)); c[W] = (b.match('w') ? '?' : (b.match('W') ? '!' : null)); c[D] = (b.match('d') ? '?' : (b.match('D') ? '!' : null)); c[H] = (b.match('h') ? '?' : (b.match('H') ? '!' : null)); c[M] = (b.match('m') ? '?' : (b.match('M') ? '!' : null)); c[S] = (b.match('s') ? '?' : (b.match('S') ? '!' : null)); return c }, _calculatePeriods: function (f, g, h) { f._now = h; f._now.setMilliseconds(0); var i = new Date(f._now.getTime()); if (f._since && h.getTime() < f._since.getTime()) { f._now = h = i } else if (f._since) { h = f._since } else { i.setTime(f._until.getTime()); if (h.getTime() > f._until.getTime()) { f._now = h = i } } var j = [0, 0, 0, 0, 0, 0, 0]; if (g[Y] || g[O]) { var k = $.countdown._getDaysInMonth(h.getFullYear(), h.getMonth()); var l = $.countdown._getDaysInMonth(i.getFullYear(), i.getMonth()); var m = (i.getDate() == h.getDate() || (i.getDate() >= Math.min(k, l) && h.getDate() >= Math.min(k, l))); var n = function (a) { return (a.getHours() * 60 + a.getMinutes()) * 60 + a.getSeconds() }; var o = Math.max(0, (i.getFullYear() - h.getFullYear()) * 12 + i.getMonth() - h.getMonth() + ((i.getDate() < h.getDate() && !m) || (m && n(i) < n(h)) ? -1 : 0)); j[Y] = (g[Y] ? Math.floor(o / 12) : 0); j[O] = (g[O] ? o - j[Y] * 12 : 0); var p = function (a, b, c) { var d = (a.getDate() == c); var e = $.countdown._getDaysInMonth(a.getFullYear() + b * j[Y], a.getMonth() + b * j[O]); if (a.getDate() > e) { a.setDate(e) } a.setFullYear(a.getFullYear() + b * j[Y]); a.setMonth(a.getMonth() + b * j[O]); if (d) { a.setDate(e) } return a }; if (f._since) { i = p(i, -1, l) } else { h = p(new Date(h.getTime()), +1, k) } } var q = Math.floor((i.getTime() - h.getTime()) / 1000); var r = function (a, b) { j[a] = (g[a] ? Math.floor(q / b) : 0); q -= j[a] * b }; r(W, 604800); r(D, 86400); r(H, 3600); r(M, 60); r(S, 1); return j } }); function extendRemove(a, b) { $.extend(a, b); for (var c in b) { if (b[c] == null) { a[c] = null } } return a } $.fn.countdown = function (a) { var b = Array.prototype.slice.call(arguments, 1); if (a == 'getTimes') { return $.countdown['_' + a + 'Countdown'].apply($.countdown, [this[0]].concat(b)) } return this.each(function () { if (typeof a == 'string') { $.countdown['_' + a + 'Countdown'].apply($.countdown, [this].concat(b)) } else { $.countdown._attachCountdown(this, a) } }) }; $.countdown = new Countdown() })(jQuery);
/*
Class:    	countDown
Author:   	David Walsh
Website:    http://davidwalsh.name
Version:  	1.0.0
Date:     	11/30/2008
Built For:  jQuery 1.2.6
*/
/* delay function */
jQuery.fn.delay = function (time, func) {
    return this.each(function () {
        setTimeout(func, time);
    });
};
jQuery.fn.countDown = function (settings, to) {
    settings = jQuery.extend({
        startFontSize: '20px',
        endFontSize: '14px',
        duration: 1000,
        startNumber: 10,
        endNumber: 0,
        callBack: function () { }
    }, settings);
    return this.each(function () {

        if (!to && to != settings.endNumber) { to = settings.startNumber; }

        //set the countdown to the starting number
        $(this).text(to).css('fontSize', settings.startFontSize);

        //loopage
        $(this).animate({
            'fontSize': settings.endFontSize
        }, settings.duration, '', function () {
            if (to > settings.endNumber + 1) {
                $(this).css('fontSize', settings.startFontSize).text(to - 1).countDown(settings, to - 1);
            }
            else {
                settings.callBack(this);
            }
        });

    });
};
/* sample usage 
$('#countdown').countDown({
startNumber: 10,
callBack: function(me) {
$(me).text('All done! This is where you give the reward!').css('color','#090');
}
});
*/
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4257 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Color functions from Steve's Cross Browser Gradient Backgrounds v1.0 (steve@slayeroffice.com && http://slayeroffice.com/code/gradient/)
 *
 * $LastChangedDate: 2007-06-26 19:52:18 -0500 (Tue, 26 Jun 2007) $
 * $Rev: 2163 $
 *
 * Version 1.0
 */
(function($){$.fn.gradient=function(options){options=$.extend({from:'000000',to:'ffffff',direction:'horizontal',position:'top',length:null},options||{});var createColorPath=function(startColor,endColor,distance){var colorPath=[],colorPercent=1.0,distance=(distance<100)?distance:100;do{colorPath[colorPath.length]=setColorHue(longHexToDec(startColor),colorPercent,longHexToDec(endColor));colorPercent-=((100/distance)*0.01);}while(colorPercent>0);return colorPath;},setColorHue=function(originColor,opacityPercent,maskRGB){var returnColor=[];for(var i=0;i<originColor.length;i++)returnColor[i]=Math.round(originColor[i]*opacityPercent)+Math.round(maskRGB[i]*(1.0-opacityPercent));return returnColor;},longHexToDec=function(longHex){return new Array(toDec(longHex.substring(0,2)),toDec(longHex.substring(2,4)),toDec(longHex.substring(4,6)));},toDec=function(hex){return parseInt(hex,16);};return this.each(function(){var $this=$(this),width=$this.innerWidth(),height=$this.innerHeight(),x=0,y=0,w=1,h=1,html=[],length=options.length||(options.direction=='vertical'?width:height),position=(options.position=='bottom'?'bottom:0;':'top:0;')+(options.position=='right'?'right:0;':'left:0;'),colorArray=createColorPath(options.from,options.to,length);if(options.direction=='horizontal'){h=Math.round(length/colorArray.length)||1;w=width;}else{w=Math.round(length/colorArray.length)||1;h=height;}html.push('<div class="gradient" style="position: absolute; '+position+' width: '+(options.direction=='vertical'?length+"px":"100%")+'; height: '+(options.direction=='vertical'?"100%":length+"px")+'; overflow: hidden; z-index: 0; background-color: #'+(options.position.indexOf('bottom')!=-1?options.from:options.to)+'">');for(var i=0;i<colorArray.length;i++){html.push('<div style="position:absolute;z-index:1;top:'+y+'px;left:'+x+'px;height:'+(options.direction=='vertical'?"100%":h+"px")+';width:'+(options.direction=='vertical'?w+"px":"100%")+';background-color:rgb('+colorArray[i][0]+','+colorArray[i][1]+','+colorArray[i][2]+');"></div>');options.direction=='vertical'?x+=w:y+=h;if(y>=height||x>=width)break;}html.push('</div>');if($this.css('position')=='static')$this.css('position','relative');$this.html('<div style="display:'+$this.css("display")+'; position: relative; z-index: 2;">'+this.innerHTML+'</div>').prepend(html.join(''));});};})(jQuery);
/*
* jQuery 9-Grid Scaling Plugin 0.9.3
*
* Copyright (c) 2008 Gordon L. Hempton ( http://hempton.com )
* Licensed under the MIT license
*/
//Here's a quick fix to render dynamic content within a 9-Grid container. Add 
//the following code to the scale9grid.js
// TODO: should resize when the text size is changed also
// TODO: this event should be removed if the element is removed from the DOM
window.scale9grid = true;
//$(window).resize(layoutGrid);
//var $tmr;
//$target.bind('DOMNodeInserted DOMNodeRemoved',function(){
//	if ($tmr) clearTimeout($tmr);
//	$tmr = setTimeout(layoutGrid,10);
//});
(function ($) {
	var supportsBorderImage = false; var borderImageStyle; if ($.browser.safari) { supportsBorderImage = true; borderImageStyle = '-webkit-border-image'; } else if ($.browser.mozilla && $.browser.version.substr(0, 3) == "1.9" && parseFloat($.browser.version.substr(3)) > 1.0) { supportsBorderImage = true; borderImageStyle = '-moz-border-image'; }
	$.fn.extend({ scale9Grid: function (settings) {
		var gridTop = settings.top || 0; var gridBottom = settings.bottom || 0; var gridLeft = settings.left || 0; var gridRight = settings.right || 0; return $(this).each(function () {
			var $target = $(this); if ($target.data('layoutGrid')) { $target.remove9Grid(); }
			var backgroundImage = $target.css('background-image'); var match = /url\("?([^\(\)"]+)"?\)/i.exec(backgroundImage); if (!match || match.length < 2) { return; }
			var backgroundUrl = match[1]; if ($.browser.msie && $.browser.version < 7 && $target.css('float') != 'none' && $target.css('position') == 'static') { $target.css('position', 'relative'); }
			$target.wrapInner('<div class="s9gwrapper"></div>'); var $wrapper = $target.find('.s9gwrapper'); $wrapper.css({ 'padding-left': $target.css('padding-left'), 'padding-right': $target.css('padding-right'), 'padding-top': $target.css('padding-top'), 'padding-bottom': $target.css('padding-bottom'), 'text-align': $target.css('text-align'), 'position': 'relative', 'z-index': '2', 'display': 'block', 'background-color': 'transparent', 'background-image': 'none' }); $target.css({ 'background-color': 'transparent', 'background-image': 'none', 'border-color': 'transparent', 'padding': '0', 'text-align': 'left' }); var backgroundElement = document.createElement('div'); $target.prepend(backgroundElement); var $background = $(backgroundElement); $background.css({ 'position': 'relative', 'width': '0px', 'height': '0px', 'z-index': '0', 'display': 'block' }); $background.addClass('s9gbackground'); if (supportsBorderImage) {
				var cssProperties = { 'border-width': gridTop + 'px ' + gridRight + 'px ' + gridBottom + 'px ' + gridLeft + 'px ', 'position': 'absolute' }
				cssProperties[borderImageStyle] = backgroundImage + ' ' + gridTop + ' ' + gridRight + ' ' + gridBottom + ' ' + gridLeft + ' stretch stretch'; $background.css(cssProperties);
			}
			var imageWidth; var imageHeight; var lastWidth = 0; var lastHeight = 0; var cells = new Array(); var layoutGrid = function () {
				var width = $target.innerWidth(); var height = $target.innerHeight(); if (width < gridLeft + gridRight || height < gridTop + gridBottom || (width == lastWidth && height == lastHeight)) { return; }
				if (supportsBorderImage) {
					$background.css({ 'width': width - gridLeft - gridRight + 'px', 'height': height - gridTop - gridBottom + 'px' })
					return;
				}
				lastWidth = width; lastHeight = height; var cellIndex = 0; var existingCells = cells.length; for (var y = 0; y < height; ) {
					var cellHeight; var verticalPosition; if (y == 0) { verticalPosition = "top"; cellHeight = Math.min(imageHeight - gridBottom, height - gridBottom); }
					else if (y + imageHeight - gridTop >= height) { verticalPosition = "bottom"; cellHeight = height - y; }
					else { verticalPosition = "center"; cellHeight = Math.min(imageHeight - gridTop - gridBottom, height - y - gridBottom); }
					for (var x = 0; x < width; cellIndex++) {
						var $cell; if (cellIndex < existingCells) { $cell = cells[cellIndex]; }
						else { cellElement = document.createElement('div'); $background.append(cellElement); $cell = $(cellElement); $cell.css({ 'position': 'absolute', 'background-image': backgroundImage }); cells.push($cell); }
						var cellWidth; var horizontalPosition; if (x == 0) { horizontalPosition = "left"; cellWidth = Math.min(imageWidth - gridRight, width - gridRight); }
						else if (x + imageWidth - gridBottom >= width) { horizontalPosition = "right"; cellWidth = width - x; }
						else { horizontalPosition = "center"; cellWidth = Math.min(imageWidth - gridLeft - gridRight, width - x - gridRight); }
						$cell.css({ 'left': x + 'px', 'top': y + 'px', 'width': cellWidth + 'px', 'height': cellHeight + 'px', 'background-position': verticalPosition + ' ' + horizontalPosition }); x += cellWidth;
					}
					y += cellHeight;
				}
				for (var i = cellIndex; i < existingCells; i++) { cells[i].remove(); }
				cells.splice(cellIndex, cells.length - cellIndex);
			}; var image = new Image(); $(image).load(function () {
				if (image.width < gridLeft + gridRight || image.height < gridTop + gridBottom) { return; }
				imageWidth = image.width; imageHeight = image.height; layoutGrid(); $(window).resize(layoutGrid);
			}).attr('src', backgroundUrl); $target.data('layoutGrid', layoutGrid);
		});
	}, remove9Grid: function () {
		return $(this).each(function () {
			var $target = $(this); if (!$target.data('layoutGrid'))
				return; $(window).unbind('resize', $target.data('layoutGrid')); $target.removeAttr('style'); var content = $target.find('.s9gwrapper').contents(); $target.prepend(content); $target.find('.s9gwrapper').remove(); $target.find('.s9gbackground').remove(); $target.removeData('layoutGrid');
		});
	}
	});
})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/*
VERSION: Drop Shadow jQuery Plugin 1.6  12-13-2007

REQUIRES: jquery.js (verified for 1.3.2)

SYNTAX: $(selector).dropShadow(options);  // Creates new drop shadows
$(selector).redrawShadow();       // Redraws shadows on elements
$(selector).removeShadow();       // Removes shadows from elements
$(selector).shadowId();           // Returns an existing shadow's ID

OPTIONS:

left    : integer (default = 4)
top     : integer (default = 4)
blur    : integer (default = 2)
opacity : decimal (default = 0.5)
color   : string (default = "black")
swap    : boolean (default = false)

The left and top parameters specify the distance and direction, in  pixels, to
offset the shadow. Zero values position the shadow directly behind the element.
Positive values shift the shadow to the right and down, while negative values 
shift the shadow to the left and up.
  
The blur parameter specifies the spread, or dispersion, of the shadow. Zero 
produces a sharp shadow, one or two produces a normal shadow, and three or four
produces a softer shadow. Higher values increase the processing load.
  
The opacity parameter should be a decimal value, usually less than one. You can
use a value higher than one in special situations, e.g. with extreme blurring. 
  
Color is specified in the usual manner, with a color name or hex value. The
color parameter does not apply with transparent images.
  
The swap parameter reverses the stacking order of the original and the shadow.
This can be used for special effects, like an embossed or engraved look.

EXPLANATION:
  
This jQuery plug-in adds soft drop shadows behind page elements. It is only
intended for adding a few drop shadows to mostly stationary objects, like a
page heading, a photo, or content containers.

The shadows it creates are not bound to the original elements, so they won't
move or change size automatically if the original elements change. A window
resize event listener is assigned, which should re-align the shadows in many
cases, but if the elements otherwise move or resize you will have to handle
those events manually. Shadows can be redrawn with the redrawShadow() method
or removed with the removeShadow() method. The redrawShadow() method uses the
same options used to create the original shadow. If you want to change the
options, you should remove the shadow first and then create a new shadow.
  
The dropShadow method returns a jQuery collection of the new shadow(s). If
further manipulation is required, you can store it in a variable like this:

var myShadow = $("#myElement").dropShadow();

You can also read the ID of the shadow from the original element at a later
time. To get a shadow's ID, either read the shadowId attribute of the
original element or call the shadowId() method. For example:

var myShadowId = $("#myElement").attr("shadowId");  or
var myShadowId = $("#myElement").shadowId();

If the original element does not already have an ID assigned, a random ID will
be generated for the shadow. However, if the original does have an ID, the 
shadow's ID will be the original ID and "_dropShadow". For example, if the
element's ID is "myElement", the shadow's ID would be "myElement_dropShadow".

If you have a long piece of text and the user resizes the window so that the
text wraps or unwraps, the shape of the text changes and the words are no
longer in the same positions. In that case, you can either preset the height
and width, so that it becomes a fixed box, or you can shadow each word
separately, like this:

<h1><span>Your</span> <span>Page</span> <span>Title</span></h1>

$("h1 span").dropShadow();

The dropShadow method attempts to determine whether the selected elements have
transparent backgrounds. If you want to shadow the content inside an element,
like text or a transparent image, it must not have a background-color or
background-image style. If the element has a solid background it will create a
rectangular shadow around the outside box.

The shadow elements are positioned absolutely one layer below the original 
element, which is positioned relatively (unless it's already absolute).

*** All shadows have the "dropShadow" class, for selecting with CSS or jQuery.

ISSUES:
  
1)  Limited styling of shadowed elements by ID. Because IDs must be unique,
and the shadows have their own ID, styles applied by ID won't transfer
to the shadows. Instead, style elements by class or use inline styles.
2)  Sometimes shadows don't align properly. Elements may need to be wrapped
in container elements, margins or floats changed, etc. or you may just 
have to tweak the left and top offsets to get them to align. For example,
with draggable objects, you have to wrap them inside two divs. Make the 
outer div draggable and set the inner div's position to relative. Then 
you can create a shadow on the element inside the inner div.
3)  If the user changes font sizes it will throw the shadows off. Browsers 
do not expose an event for font size changes. The only known way to 
detect a user font size change is to embed an invisible text element and
then continuously poll for changes in size.
4)  Safari support is shaky, and may require even more tweaks/wrappers, etc.
    
The bottom line is that this is a gimick effect, not PFM, and if you push it
too hard or expect it to work in every possible situation on every browser,
you will be disappointed. Use it sparingly, and don't use it for anything 
critical. Otherwise, have fun with it!
        
AUTHOR: Larry Stevens.  This work is in the public domain,
and is not supported in any way. Use it at your own risk.
*/


(function ($) {

    var dropShadowZindex = 1;  //z-index counter

    $.fn.dropShadow = function (options) {
        // Default options
        var opt = $.extend({
            left: 4,
            top: 4,
            blur: 2,
            opacity: .5,
            color: "black",
            swap: false
        }, options);
        var jShadows = $([]);  //empty jQuery collection

        // Loop through original elements
        this.not(".dropShadow").each(function () {
            var jthis = $(this);
            var shadows = [];
            var blur = (opt.blur <= 0) ? 0 : opt.blur;
            var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8);
            var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1;
            var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex;

            // Create ID for shadow
            var shadowId;
            if (this.id) {
                shadowId = this.id + "_dropShadow";
            }
            else {
                shadowId = "ds" + (1 + Math.floor(9999 * Math.random()));
            }

            // Modify original element
            $.data(this, "shadowId", shadowId); //store id in expando
            $.data(this, "shadowOptions", options); //store options in expando
            jthis
        .attr("shadowId", shadowId)
        .css("zIndex", zOriginal);
            if (jthis.css("position") != "absolute") {
                jthis.css({
                    position: "relative",
                    zoom: 1 //for IE layout
                });
            }

            // Create first shadow layer
            bgColor = jthis.css("backgroundColor");
            if (bgColor == "rgba(0, 0, 0, 0)") bgColor = "transparent";  //Safari
            if (bgColor != "transparent" || jthis.css("backgroundImage") != "none"
          || this.nodeName == "SELECT"
          || this.nodeName == "INPUT"
          || this.nodeName == "TEXTAREA") {
                shadows[0] = $("<div></div>")
          .css("background", opt.color);
            }
            else {
                shadows[0] = jthis
          .clone()
          .removeAttr("id")
          .removeAttr("name")
          .removeAttr("shadowId")
          .css("color", opt.color);
            }
            shadows[0]
        .addClass("dropShadow")
        .css({
            height: jthis.outerHeight(),
            left: blur,
            opacity: opacity,
            position: "absolute",
            top: blur,
            width: jthis.outerWidth(),
            zIndex: zShadow
        });

            // Create other shadow layers
            var layers = (8 * blur) + 1;
            for (i = 1; i < layers; i++) {
                shadows[i] = shadows[0].clone();
            }

            // Position layers
            var i = 1;
            var j = blur;
            while (j > 0) {
                shadows[i].css({ left: j * 2, top: 0 });           //top
                shadows[i + 1].css({ left: j * 4, top: j * 2 });   //right
                shadows[i + 2].css({ left: j * 2, top: j * 4 });   //bottom
                shadows[i + 3].css({ left: 0, top: j * 2 });       //left
                shadows[i + 4].css({ left: j * 3, top: j });       //top-right
                shadows[i + 5].css({ left: j * 3, top: j * 3 });   //bottom-right
                shadows[i + 6].css({ left: j, top: j * 3 });       //bottom-left
                shadows[i + 7].css({ left: j, top: j });           //top-left
                i += 8;
                j--;
            }

            // Create container
            var divShadow = $("<div></div>")
        .attr("id", shadowId)
        .addClass("dropShadow")
        .css({
            left: jthis.position().left + opt.left - blur,
            marginTop: jthis.css("marginTop"),
            marginRight: jthis.css("marginRight"),
            marginBottom: jthis.css("marginBottom"),
            marginLeft: jthis.css("marginLeft"),
            position: "absolute",
            top: jthis.position().top + opt.top - blur,
            zIndex: zShadow
        });

            // Add layers to container  
            for (i = 0; i < layers; i++) {
                divShadow.append(shadows[i]);
            }

            // Add container to DOM
            jthis.after(divShadow);

            // Add shadow to return set
            jShadows = jShadows.add(divShadow);

            // Re-align shadow on window resize
            $(window).resize(function () {
                try {
                    divShadow.css({
                        left: jthis.position().left + opt.left - blur,
                        top: jthis.position().top + opt.top - blur
                    });
                }
                catch (e) { }
            });

            // Increment z-index counter
            dropShadowZindex += 2;

        });  //end each

        return this.pushStack(jShadows);
    };


    $.fn.redrawShadow = function () {
        // Remove existing shadows
        this.removeShadow();

        // Draw new shadows
        return this.each(function () {
            var shadowOptions = $.data(this, "shadowOptions");
            $(this).dropShadow(shadowOptions);
        });
    };


    $.fn.removeShadow = function () {
        return this.each(function () {
            var shadowId = $(this).shadowId();
            $("div#" + shadowId).remove();
        });
    };


    $.fn.shadowId = function () {
        return $.data(this[0], "shadowId");
    };


    $(function () {
        // Suppress printing of shadows
        var noPrint = "<style type='text/css' media='print'>";
        noPrint += ".dropShadow{visibility:hidden;}</style>";
        $("head").append(noPrint);
    });

})(jQuery);
/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */
(function ($) {
    $.fn.lightBox = function (settings) {
        settings = jQuery.extend({ overlayBgColor: '#000', overlayOpacity: 0.8, fixedNavigation: false, imageLoading: '/App_Themes/OpenWeb/OwImages/vi-VN/lightbox-ico-loading.gif', imageBtnPrev: '/App_Themes/OpenWeb/OwImages/vi-VN/lightbox-btn-prev.gif', imageBtnNext: '/App_Themes/OpenWeb/OwImages/vi-VN/lightbox-btn-next.gif', imageBtnClose: '/App_Themes/OpenWeb/OwImages/vi-VN/lightbox-btn-close.gif', imageBlank: '/App_Themes/OpenWeb/OwImages/vi-VN/lightbox-blank.gif', containerBorderSize: 10, containerResizeSpeed: 400, txtImage: 'Image', txtOf: 'of', keyToClose: 'c', keyToPrev: 'p', keyToNext: 'n', imageArray: [], activeImage: 0 }, settings); var jQueryMatchedObj = this; function _initialize() { _start(this, jQueryMatchedObj); return false; }
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}
